package org.example.demoone.service;

import org.example.demoone.entity.Student;
import org.springframework.jdbc.core.JdbcTemplate;

public class StudentServiceIml implements StudentService{

    JdbcTemplate jdbcTemplate;
    public  StudentServiceIml(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }
    @Override
    public void addStudent(Student stu) {
        String sql="insert into student(number,name,password) values(?,?,?)";
        jdbcTemplate.update(sql, stu.getName(), stu.getPassword(), stu.getNumber());
    }
    @Override
    public int updateStudent(Student stu) {
        return 0;
    }
    @Override
    public int deleteStudent(String name) {
        return 0;
    }
    @Override
    public Student findStudent(String name) {
        return null;
    }
}
